<template>
    <div>
        <div class="bread_crumb">
            <bread-crumb></bread-crumb>
        </div>
        <div class="stu_info_wrap">
            <div class="stu_info">
                <h1>学生入学成绩录入</h1>
                <el-form ref="form" :model="form" label-width="70px" >
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="学号"  prop="stu_id">
                            <el-input v-model.trim="form.stu_id" ></el-input>
                        </el-form-item>
                        <el-form-item label="姓名" prop="stu_name">
                            <el-input v-model.trim="form.stu_name" ></el-input>
                        </el-form-item>
                        <el-form-item label="语文" prop="chinese">
                            <el-input v-model.trim="form.chinese" ></el-input>
                        </el-form-item>
                        <el-form-item label="英语" prop="english">
                            <el-input v-model.trim="form.english" ></el-input>
                        </el-form-item>
                        <el-form-item label="数学" prop="math">
                            <el-input v-model.trim="form.math" ></el-input>
                        </el-form-item>
                        <el-form-item label="理综" prop="lizong">
                            <el-input v-model.trim="form.lizong" ></el-input>
                        </el-form-item>
                        <el-form-item label="文综" prop="wenzong">
                            <el-input v-model.trim="form.wenzong" ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-form-item>
                    <el-button type="primary" :plain="true" @click="onSubmit">提交</el-button>
                    <el-button  @click="goReset">重置</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>
    </div>
</template>

<script>
import {req_extry_exam} from '@/api/examInfo.js';
    export default{
        data(){
            return{
                form:{
                    stu_id:'',
                    stu_name:'',
                    chinese:'',
                    english:'',
                    math:'',
                    lizong:'',
                    wenzong:'',
                }
                }
            },
        async mounted(){
            let result=await req_extry_exam();
            console.log(result);
        },
        methods:{
            async onSubmit(){
                let result=await req_extry_exam(this.form);
                console.log(result);
                console.log('这是提交按钮');
                // 设置弹窗提醒
                this.$message({
                    message:'数据提交成功',
                    type:'success',
                    offset:130,
                })
                // 调用重置
                this.goReset()
            },
            goReset(){
                console.log('这是重置按钮');
                this.$refs.form.resetFields();
            },
        },
    }
</script>

<style lang="scss" scoped>
    div{
        .bread_crumb {
            height: 30px;
        }
            .stu_info_wrap{
            .stu_info{
                h1{
                    margin-bottom: 12px;
                    text-align: center;
                }
                .Editwrap{
                    height: 120px;
                    overflow: hidden;
                }
            }
        }
    }
</style>